package com.mysoft.gfyx.workbench.service.ProfitProduct;

import com.mysoft.gfyx.workbench.dao.entity.PermTenantProfit;
import com.mysoft.gfyx.workbench.service.ProfitProductService;
import com.mysoft.gfyx.workbench.service.ProfitService;

import java.util.Iterator;
import java.util.List;

public class UserAccount implements ProfitProductService {

    public Integer getAccountNumber(List<PermTenantProfit> profits) {
        Integer maxNumber = 0;

        Iterator<PermTenantProfit> it = profits.iterator();
        while (it.hasNext()) {
            PermTenantProfit s = it.next();
            if (s.getProductCode().equals(ProfitService.Product.UserAccount.toString())) {
                maxNumber += 1 * s.getNumber();
            }
        }

        return maxNumber;
    }
}
